﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.MdProductOrder.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.MdProductOrder;
/// <summary>
/// 分页获取订单列表服务
/// </summary>
public class GetMdProductOrderPageListService : ApiBase<RequestGetMdProductOrderPageListModel>
{
    /// <summary>
    /// 订单仓储
    /// </summary>
    public MdProductOrderRep mdProductOrderRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new MdProductOrderModel();

        model.ProductTitle = Parameter.ProductTitle;
        model.ProductCategory = Parameter.ProductCategory;

        model.UserEmail = Parameter.UserEmail;
        model.UserName = Parameter.UserName;
        model.UserNick = Parameter.UserNick;
        model.UserType = Parameter.UserType;
        model.UserSex = Parameter.UserSex;
        model.UserPhone = Parameter.UserPhone;

        model.AddressCountry = Parameter.AddressCountry;
        model.AddressProvince = Parameter.AddressProvince;
        model.AddressCity = Parameter.AddressCity;
        model.AddressDistrict = Parameter.AddressDistrict;
        model.AddressName = Parameter.AddressName;
        model.AddressEmail = Parameter.AddressEmail;

        model.ProductId = Parameter.ProductId;
        model.UserId = Parameter.UserId;
        model.AddressId = Parameter.AddressId;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = mdProductOrderRep.GetMdUserExperiencerPageList(model, Parameter.PageIndex, Parameter.PageSize, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}

